<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" uri="/iuie-tag"%>
<%@ taglib prefix="sys" uri="/sys-tag" %>
<%@ taglib prefix="lui" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>报表信息修改</title>
</head>
<lui:context/>
<u:View basePath="/res-system/report" userJS="reportAdd" delayLoadJs="false">
<body>
    <lui:dialogBody>
        <form class="m-cust m-narrow" id='reportAddFrm'>
        	<sys:dropCodeSet codeTypes="reportCategory" id="codeSet"/>
        	<div class="form-group row m-narrow">
			    <div class="col-sm-4 col-md-4 col-xs-4">
			    	<div class="input-group">
					    <label for="reportKey" class="input-group-addon">报表KEY</label>
					    <input name="reportKey" id="reportKey" type="text" class="form-control" data-validate='true' data-not-empty="true" 
					    	data-empty-text="报表KEY不能为空" maxlength="100" data-0-regexp="^[a-zA-Z_][a-zA-Z0-9_]{1,32}$" 
        					data-0-error-text="格式不合法<br>格式：以英文26个字母开头，大小写随意，内容仅能为26个英文字母或下划线" data-prompt="dialog">
					</div>
			    </div>
			    <div class="col-sm-4 col-md-4 col-xs-4">
			    	<div class="input-group">
					    <label for="reportName" class="input-group-addon">报表名称</label>
					    <input name="reportName" id="reportName" type="text" class="form-control" data-validate='true' data-not-empty="true" 
					    	data-empty-text="报表名称不能为空" maxlength="100">
					</div>
			    </div>
			    <div class="col-sm-4 col-md-4 col-xs-4">
			    	<div class="input-group">
					    <label for="reportCategory" class="input-group-addon">所属业务</label>
						<lui:dropList id="reportCategory" name="reportCategory" className="form-control m-input" dropValues="codeSet.reportCategory" 
							showSelectAll="true" showSelectName="请选择"/>
					</div>
			    </div>
			</div>
			<div class="form-group row m-narrow">
				<div class="col-sm-12 col-md-12 col-xs-12">
					<div class="input-group">
						<span class="input-group-addon">数据加载器</span>
						<input type="text" class="form-control" placeholder="类全路径" name="className" data-validate='true' data-not-empty="true" 
					    	data-empty-text="类全路径不能为空！" maxlength="50" data-prompt="dialog">
						<span class="input-group-addon fix-border fix-padding">变量名</span>
						<input type="text" class="form-control" placeholder="变量名" name="variableName" data-validate='true' data-not-empty="true" 
					    	data-empty-text="变量名不能为空！" maxlength="50" data-prompt="dialog">
						<span class="input-group-addon fix-border fix-padding">方法名</span>
						<input type="text" class="form-control" placeholder="方法名" name="methodName" data-validate='true' data-not-empty="true" 
					    	data-empty-text="方法名不能为空！" maxlength="50" data-prompt="dialog">
					</div>
				</div>
			</div>
			<div class="form-group row m-narrow">
				<div class="col-sm-1 col-md-1 col-xs-1">
		            <label class='m-label m-float-right' for="reportJson">报表JSON：</label>
		        </div>
				<div class="col-sm-11 col-md-11 col-xs-11">
					<textarea rows="28" cols="" name="reportJson" id='reportJson' class="form-control m-input" data-validate='true' data-not-empty="true" 
					    data-empty-text="报表Json对象不能为空" maxlength="4000" style="line-height: 1.2em; font-family: Consolas"></textarea>
				</div>
			</div>
			<div class="form-group row m-narrow">
				<div class="col-sm-1 col-md-1 col-xs-1">
		            <label class='m-label m-float-right' for="reportDesc">报表描述：</label>
		        </div>
				<div class="col-sm-11 col-md-11 col-xs-11">
					<textarea rows="2" cols="" name="reportDesc" id='reportDesc' class="form-control m-input" maxlength="100"></textarea>
				</div>
			</div>
			<lui:ajax id="addOneAjax" url="${ctx }/report/add/one" formQuery="#reportAddFrm" 
    			formSubmit="true" onSuccess="ReportAddPage.onSaveSucc" type="post" contentType="application/x-www-form-urlencoded"/>
    		<c:if test="${not empty requestScope.reportId }">
	    		<lui:ajax id="findByIdAjax" url="${ctx }/report/find/id/${requestScope.reportId }" autoSend="true" 
	    			onSuccess="ReportAddPage.onFindOneSucc"/>
	    		<input hidden="hidden" name="reportId">
    		</c:if>
        </form>
    </lui:dialogBody>
    <lui:dialogFooter>
       <button class="btn btn-primary m-btn" type="button" onclick="ReportAddPage.save()">保存</button>
       <button class="btn btn-default m-btn" type="button" data-dismiss="dialog-box">关闭</button>
    </lui:dialogFooter>
</body>
</u:View>
</html>